package org.example.design.visitor.visitor.impl;

import org.example.design.visitor.user.impl.Student;
import org.example.design.visitor.user.impl.Teacher;
import org.example.design.visitor.visitor.Visitor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @Classname Principal
 * @Description 访问者（校长）
 * @Date 2020/11/12 2:28 下午
 * @Created by xiangjd
 */
public class Principal implements Visitor {

    private Logger logger = LoggerFactory.getLogger(Principal.class);

    @Override
    public void visist(Student student) {
        logger.info("学生信息 姓名: {},班级: {}", student.name, student.clazz);
    }

    @Override
    public void visist(Teacher teacher) {
        logger.info("老师信息 姓名: {},班级: {},升学率: {}", teacher.name, teacher.clazz, teacher.entranceRatio());
    }
}
